//
//  HEHealthHisItemCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/12/28.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEHealthHisItemCell.h"

@interface HEHealthHisItemCell ()

@property (weak, nonatomic) UILabel *titleLabel;

@end

@implementation HEHealthHisItemCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self configUI];
    }
    return self;
}

- (void)configUI {
    self.contentView.backgroundColor = CSplitLineColor;
    UILabel *label = [UILabel new];
    label.backgroundColor = CSplitLineColor;
    label.font = DYFont(15);
    label.textColor = [UIColor blackColor];
    label.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:label];
    self.titleLabel = label;
    
    self.contentView.layer.cornerRadius = 6;
    self.contentView.layer.masksToBounds = YES;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.titleLabel.frame = self.bounds;
}

- (void)setModel:(HEHealthHisItemModel *)model {
    self.titleLabel.text = model.title;
    
    if (model.isSelect) {
        self.titleLabel.backgroundColor = CNavBgColor;
        self.titleLabel.textColor = KWhiteColor;
    }else {
        self.titleLabel.backgroundColor = CSplitLineColor;
        self.titleLabel.textColor = [UIColor blackColor];
    }
}
 
 

@end
